/**
 * @Author: 24448
 * @ClassName: Test04
 * @Date: 2021/11/22 16:40
 * @Description: //TODO
 * @Version: V1.0
 **/
public class Test04 {

    /**
     * -Xmx256m -Xms256m  -XX:+DoEscapeAnalysis -XX:+PrintGCDetails  开启逃逸分析
     * -Xmx256m -Xms256m  -XX:-DoEscapeAnalysis -XX:+PrintGCDetails  关闭逃逸分析
     * <p>
     * 注意：不要 使用debug 运行 测试逃逸分析 效果， 否则无效!!!!!
     *
     * @param args
     * @throws InterruptedException
     */
    public static void main(String[] args) throws InterruptedException {
        long start = System.currentTimeMillis();
        for (int i = 0; i <= 10000000; i++) {
            mayikt();
        }
        long end = System.currentTimeMillis();
        System.out.println("程序执行的时间:" + (end - start));
        Thread.sleep(1000000);
    }

    public static void mayikt() {
        // 未发生逃逸
        User user = new User();
    }

    static class User {

    }
}
